VSCode のマッピングの設定
from VSCode Neovim で暮らす
VSCode のマッピングの設定
これをするだけで全然変わる
code:neovimの再起動 (init.nvimも再読み込みできる).json
{
"key": "ctrl+shift+e",
"command": "vscode-neovim.restart"
}
{
"key": "ctrl+shift+e",
"command": "-workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "ctrl+shift+e",
"command": "-workbench.action.quickOpenNavigatePreviousInFilePicker",
"when": "inFilesPicker && inQuickOpen"
}
code:ファイルエクスプローラーのトグル.json
{
"key": "ctrl+e",
"command": "-vscode-neovim.ctrl-e",
"when": "editorTextFocus && neovim.ctrlKeysNormal.e && neovim.init && neovim.mode != 'insert' && editorLangId not in 'neovim.editorLangIdExclusions'"
},
{
"key": "ctrl+e",
"command": "workbench.view.explorer",
"when": "editorTextFocus && neovim.ctrlKeysNormal.e && neovim.init && neovim.mode != 'insert' && editorLangId not in 'neovim.editorLangIdExclusions'"
},
{
"key": "ctrl+e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarFocus"
},
{
"key": "ctrl+e",
"command": "-workbench.action.quickOpen"
},
code:エクスプローラー内での操作.json
// ファイル作成
{
"key": "shift+k",
"command": "explorer.newFile",
"when": "filesExplorerFocus && !inputFocus"
},
// 選択
{
"key": "shift+j",
"command": "list.toggleSelection",
"when": "listFocus && !inputFocus && !treestickyScrollFocused"
},
{
"key": "ctrl+shift+enter",
"command": "-list.toggleSelection",
"when": "listFocus && !inputFocus && !treestickyScrollFocused"
},
code:Git関連.json
// ソース管理を開く
{
"key": "ctrl+g ctrl+g",
"command": "workbench.view.scm"
},
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine"
},
// Gitのファイルを開く (ファイルにフォーカスが当たっている状態で変更を開く)
{
"key": "ctrl+g ctrl+f",
"command": "git.openFile",
"when": "config.git.enabled && isInDiffEditor && !git.missing && gitOpenRepositoryCount != '0' && resourceScheme =~ /^git$|^vscode-remote$/"
},
// Gitの差分を開く (ファイルにフォーカスが当たっている状態で変更を開く)
{
"key": "ctrl+g ctrl+c",
"command": "git.openChange"
},
code:Escでバッファに移動.json
{
"key": "escape",
"command": "workbench.action.focusActiveEditorGroup",
"when": "sideBarFocus"
},
code:VSCodeの再読み込み.json
{
"key": "ctrl+shift+r",
"command": "workbench.action.reloadWindow",
"when": ""
},
code:ファイルパスのコピー.json
// -------------------------
// ファイルパスのコピー
// フォーカスに当たっているファイルのパスをコピーする (エクスプローラーでもOK)
// Copilot にファイルパスを渡すときに Alt+C を押してコピペできるようにする
{
"key": "alt+c",
"command": "copyRelativeFilePath",
"when": "!editorFocus"
},
{
"key": "ctrl+k ctrl+shift+c",
"command": "-copyRelativeFilePath",
"when": "!editorFocus"
},
{
"key": "alt+c",
"command": "copyRelativeFilePath",
"when": "editorFocus"
},
{
"key": "ctrl+k ctrl+shift+c",
"command": "-copyRelativeFilePath",
"when": "editorFocus"
},
// -------------------------
copilot 関連
tamago324.icon 2025/1/25 最近、やっと AI を使うようになったから、キーバインドを少し変えている
code:json
// ctrl+# で Copilot をトグル
{
"key": "ctrl+shift+3",
"command": "workbench.panel.chat.view.copilot.focus"
},
// Ctrl+N で新しいチャット
{
"key": "ctrl+n",
"command": "workbench.action.chat.newChat",
"when": "chatIsEnabled && inChat"
},
{
"key": "ctrl+l",
"command": "-workbench.action.chat.newChat",
"when": "chatIsEnabled && inChat"
},
// Ctrl+Q でクイックチャット
{
"key": "ctrl+q",
"command": "workbench.action.openQuickChat"
},
{
"key": "ctrl+q",
"command": "-workbench.action.quickOpenView"
},
{
"key": "ctrl+q",
"command": "-workbench.action.quickOpenNavigateNextInViewPicker",
"when": "inQuickOpen && inViewsPicker"
},
// Ctrl+? でコンテキストをアタッチ
{
"key": "ctrl+oem_2",
"command": "-workbench.action.chat.attachContext",
"when": "inChatInput && chatLocation == 'panel' || config.chat.experimental.variables.editor && inChatInput && chatLocation == 'editor' || config.chat.experimental.variables.notebook && inChatInput && chatLocation == 'notebook' || config.chat.experimental.variables.terminal && inChatInput && chatLocation == 'terminal'"
},
{
"key": "ctrl+shift+oem_2",
"command": "workbench.action.chat.attachContext"
}
GitHub Copilot で enter で改行、ctrl+enter で送信する
code:最大化のトグル.json
// alt+z で最大化のトグル
{
"key": "alt+z",
"command": "workbench.action.toggleMaximizedAuxiliaryBar"
},
拡張機能のキーマッピング
Copy Relative Path and Line Numbers 拡張機能
選択している行のパス、行番号をコピーして、そこに対してコメントをしたいときに使える
code:ファイルのパスと行番号のコピー.json
// --------------------------
// Alt+s でファイルのパスと行番号のコピー
{
"key": "alt+s",
"command": "-markdown.extension.editing.toggleStrikethrough",
"when": "editorTextFocus && !editorReadonly && editorLangId =~ /^markdown$|^rmd$|^quarto$/"
},
{
"key": "alt+s",
"command": "copy-relative-path-and-line-numbers.both",
"when": "editorTextFocus"
},
{
"key": "alt+l",
"command": "-copy-relative-path-and-line-numbers.both",
"when": "editorTextFocus"
},
// --------------------------